{% extends "base.html" %}
{% block body %}

{{ pagedown.include_pagedown() }}
	




<div class="container">
<div class="row">
	<div class="col-md-12">
		<div style="box-shadow:5px 5px 20px #CCC;background-color:white;padding:20px 30px;margin-bottom:40px;">
		<h2 class="text-center">TO WRITE A BLOG!</h2>
		{% if messages %}
		{% for message in messages %}
		<p class="alert alert-warning">{{ message }}</p>
		{% endfor %}
		{% endif %}
		{% macro render_field(field) %}
		{% for error in field.errors %}
		{{ error }}
		{% endfor %}
		{% endmacro %}
			<form class="form-horizontal" method="post" action="">
				{{ form.csrf_token }}
				<div class="form-group">
    					<label for="inputEmail3" class="col-sm-1 control-label">{{ form.title.label }}</label>
    						<div class="col-sm-11">
      						{{ form.title(class="form-control",placeholder="the title") }}
   						 </div>
  				</div>
  				<div class="form-group">
    					<label for="inputEmail3" class="col-sm-1 control-label">{{ form.body.label }}</label>
    						<div class="col-sm-11">
      						{{ form.body(class="form-control",placeholder="the body") }}
   						 </div>
  				</div>
  				<div class="form-group">
    					<label for="inputEmail3" class="col-sm-1 control-label">{{ form.summury.label }}</label>
    						<div class="col-sm-11">
      						{{ form.summury(class="form-control",placeholder="the summury") }}
   						 </div>
  				</div>
  				
                        <div class="form-group">
                          <label for="inputEmail3" class="col-sm-1 control-label">{{ form.category.label }}</label>
                          <div class="col-sm-11">
                          {% for category in the_category %}
                          <div class="col-md-3"><a class="btn btn-info btn-large btn-block col-md-3 form-btn write-form-btn">{{ category.tag }}</a></div>
                          {% endfor %}
                          <div class="col-md-3"><a class="btn btn-info btn-large btn-block col-md-3 form-add write-form-btn">增加tag <span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></div>
                          </div>
                        </div>
                        <div class="form-group" id="form_category" style="display:none">
                         <label for="inputEmail3" class="col-sm-1 control-label">{{ form.category.label }}</label>
                <div class="col-sm-11">
                  {{ form.category(class="form-control",placeholder="the category") }}
               </div>
          </div>
  				
  				<input type="submit" value="Go" class="btn btn-large btn-block btn-primary">
			</form>
			
		</div>
		
  	</div>
  	
</div>
</div>





{% endblock %}